170. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2023-07-12 04:42:42 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

170.1 Files compared

#LocationFileLast Modified
12023-07-12 04:42:42 +0000
2Porto v4.0.6/Theme Files/Porto Theme/app/code/Smartwave/Filterproducts/view/frontend/templates/widgetmasonry_grid.phtml2023-07-12 04:24:15 +0000

170.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged00
Changed00
Inserted1389
Removed00

170.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

170.4 Active regular expressions

No regular expressions were active.

170.5 Comparison detail

    1 <?php
    2 /**
    3  * Copyright © 2015 Magento. All rights reserved.
    4  * See COPYING.txt for license details.
    5  */
    6 use Magento\Framework\App\Action\Action;
    7 
    8 // @codingStandardsIgnoreFile
    9 ?>
    10 <?php
    11 /**
    12  * Product list template
    13  *
    14  * @var $block \Smartwave\Filterproducts\Block\
    15  */
    16 ?>
    17 <?php
    18 if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())) {
    19   $_productCollection = $block->getProductCollection()->getItems();
    20   $_helper = $this->helper('Magento\Catalog\Helper\Output');
    21   $_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
    22   $_portohelper = $this->helper('Smartwave\Porto\Helper\Data');
    23   $review_model = $_portohelper->getModel('\Magento\Review\Model\Review');
    24   $_category_config = $_portohelper->getConfig('porto_settings/category');
    25   $_category_grid_config = $_portohelper->getConfig('porto_settings/category_grid');
    26   $_product_label_config = $this->helper('Smartwave\Porto\Helper\Data')->getConfig('porto_settings/product_label');
    27 
    28   $aspect_ratio = $this->getData("aspect_ratio");
    29   if($aspect_ratio == null) {
    30       $aspect_ratio = $_category_config['aspect_ratio'];
    31   }
    32   $image_width = $this->getData("image_width");
    33   if(!$image_width) {
    34       $image_width = ($_category_config['ratio_width'])?$_category_config['ratio_width']:300;
    35   }
    36   $image_height = $this->getData("image_height");
    37   if($aspect_ratio)
    38       $image_height = $image_width;
    39   if(!$image_height) {
    40       $image_height = ($_category_config['ratio_height'])?$_category_config['ratio_height']:300;
    41   }
    42   $masonry_layout = $this->getData("masonry_layout");
    43   if($masonry_layout == null) {
    44       $masonry_layout = '1';
    45   }
    46   $product_type = $this->getData("product_type");
    47   if($product_type == null) {
    48       $product_type = 1;
    49   }
    50   $masonry_id = $this->getData("name");
    51   if($masonry_id == null) {
    52       $masonry_id = "masonry_1";
    53   }
    54   if($product_type == 1) {
    55       $product_type = 7;
    56   }else if($product_type == 2) {
    57       $product_type = 8;
    58   }else if($product_type == 3) {
    59       $product_type = 11;
    60   }
    61   $gap_width = $this->getData("gap_width");
    62   if($gap_width == null) {
    63       $gap_width = 0;
    64   }
    65   $gap_width = $gap_width / 2;
    66 
    67   $grid_height = $this->getData("grid_height");
    68   if($grid_height == null) {
    69       $grid_height = 600;
    70   }
    71   $product_grid_layout_arr = array();
    72   if ( '1' == $masonry_layout ) {
    73       $product_grid_layout_arr = array(
    74           array( 'height' => '1', 'width' => '1-2', 'width_md' => '1' ),
    75           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
    76           array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2' ),
    77           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
    78       );
    79   }
    80   if ( '2' == $masonry_layout ) {
    81       $product_grid_layout_arr = array(
    82           array( 'height' => '2-3', 'width' => '1-2', 'width_md' => '1' ),
    83           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
    84           array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2' ),
    85           array( 'height' => '1-3', 'width' => '1-2', 'width_md' => '1' ),
    86           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
    87       );
    88   }
    89   if ( '3' == $masonry_layout ) {
    90       $product_grid_layout_arr = array(
    91           array( 'height' => '1', 'width' => '1-2', 'width_md' => '1' ),
    92           array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2' ),
    93           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
    94           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
    95       );
    96   }
    97   if ( '4' == $masonry_layout ) {
    98       $product_grid_layout_arr = array(
    99           array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1' ),
    100           array( 'height' => '1-2', 'width' => '5-12', 'width_md' => '1' ),
    101           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1' ),
    102           array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1' ),
    103           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1' ),
    104           array( 'height' => '1-2', 'width' => '5-12', 'width_md' => '1' ),
    105       );
    106   }
    107   if ( '5' == $masonry_layout ) {
    108       $product_grid_layout_arr = array(
    109           array( 'height' => '1', 'width' => '2-5', 'width_md' => '1', 'width_lg' => '1-2' ),
    110           array( 'height' => '1', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    111           array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    112           array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    113           array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    114           array( 'height' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    115       );
    116   }
    117   if ( '6' == $masonry_layout ) {
    118       $product_grid_layout_arr = array(
    119           array( 'height' => '2-3', 'width' => '1-2', 'width_md' => '1', 'width_lg' => '1-2' ),
    120           array( 'height' => '2-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    121           array( 'height' => '1', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    122           array( 'height' => '1-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    123           array( 'height' => '1-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    124           array( 'height' => '1-3', 'width' => '1-4', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    125       );
    126   }
    127   if ( '7' == $masonry_layout ) {
    128       $product_grid_layout_arr = array(
    129           array( 'height' => '1', 'width' => '1-2', 'width_md' => '1-2' ),
    130           array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ),
    131           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
    132           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
    133           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
    134           array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ),
    135           array( 'height' => '1-2', 'width' => '1-4', 'width_md' => '1-2' ),
    136           array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ),
    137           array( 'height' => '1', 'width' => '1-2', 'width_md' => '1-2' ),
    138           array( 'height' => '1-2', 'width' => '1-2', 'width_md' => '1-2' ),
    139       );
    140   }
    141   if ( '8' == $masonry_layout ) {
    142       $product_grid_layout_arr = array(
    143           array( 'height' => '1', 'width' => '1-3', 'width_md' => '1-2' ),
    144           array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
    145           array( 'height' => '1', 'width' => '1-3', 'width_md' => '1-2' ),
    146           array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
    147           array( 'height' => '1-2', 'width' => '1-6', 'width_md' => '1-2' ),
    148           array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
    149           array( 'height' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
    150           array( 'height' => '1-2', 'width' => '1-6', 'width_md' => '1-2' ),
    151       );
    152   }
    153   if ( '9' == $masonry_layout ) {
    154       $product_grid_layout_arr = array(
    155           array( 'height' => '1', 'width' => '2-5', 'width_md' => '1', 'width_lg' => '2-3' ),
    156           array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-3' ),
    157           array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-3' ),
    158           array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    159           array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    160           array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    161           array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-5', 'width_md' => '1-2', 'width_lg' => '1-2' ),
    162       );
    163   }
    164   if ( '10' == $masonry_layout ) {
    165       $product_grid_layout_arr = array(
    166           array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '2-3', 'width_md' => '1' ),
    167           array( 'height' => '1', 'height_md' => '1', 'width' => '1-3', 'width_md' => '1-2' ),
    168           array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
    169           array( 'height' => '1-2', 'height_md' => '1-2', 'width' => '1-3', 'width_md' => '1-2' ),
    170       );
    171   }
    172   $product_limit = count($product_grid_layout_arr);
    173 }
    174 ?>
    175 <?php if (!$exist): ?>
    176     <div class="message info empty"><div><?php echo __('We can\'t find products matching the selection.') ?></div></div>
    177 <?php else: ?>
    178     <?php
    179     $viewMode = 'grid';
    180     $image = 'category_page_grid';
    181     $hover_image = 'category_page_grid-hover';
    182     $showDescription = false;
    183     $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
    184     ?>
    185     <div id="<?php echo $masonry_id; ?>" class="wrapper <?php echo $viewMode; ?> products-<?php echo $viewMode; ?> masonry-grid">
    186         <?php $iterator = 1; ?>
    187         <div class="filterproducts products list items product-items">
    188             <?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
    189             <?php foreach ($_productCollection as $_product): ?>
    190                 <?php if($product_limit >= $iterator): ?>
    191                 <?php echo($iterator++ == 1) ? '<div class="item product product-item '.$_portohelper->getMasonryItemClass($product_grid_layout_arr[$iterator-2]).'">' : '</div><div class="item product product-item '.$_portohelper->getMasonryItemClass($product_grid_layout_arr[$iterator-2]).'">' ?>
    192                 <div class="product-item-info type<?php echo $product_type; ?>" data-container="product-grid">
    193                     <?php // Product Image ?>
    194                     <div class="product photo product-item-photo">
    195                         <a href="<?php echo $_product->getProductUrl() ?>" tabindex="-1">
    196                         <?php
    197                             if($aspect_ratio)
    198                                 $productImage = $_imagehelper->init($_product, $image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize($image_width);
    199                             else
    200                                 $productImage = $_imagehelper->init($_product, $image)->resize($image_width, $image_height);
    201                             $productImageUrl = $productImage->getUrl();
    202                         ?>
    203                             <img class="product-image-photo default_image" src="<?php echo $productImageUrl; ?>" width="<?php echo $image_width; ?>" height="<?php echo $image_height; ?>" alt="<?php //echo $productImage->getLabel();?>"/>
    204                         <?php if($_category_config['alternative_image']): ?>
    205                         <?php
    206                             if($aspect_ratio)
    207                                 $productHoverImage = $_imagehelper->init($_product, $hover_image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize($image_width);
    208                             else
    209                                 $productHoverImage = $_imagehelper->init($_product, $hover_image)->resize($image_width, $image_height);
    210                             $productHoverImageUrl = $productHoverImage->getUrl();
    211                         ?>
    212                             <?php if($productImageUrl != str_replace("/thumbnail/","/small_image/",$productHoverImageUrl)): ?>
    213                             <img class="product-image-photo hover_image" src="<?php echo $productHoverImageUrl; ?>" alt="<?php //echo $productHoverImage->getLabel();?>"/>
    214                             <?php endif; ?>
    215                         <?php endif; ?>
    216                         </a>
    217                         <?php
    218                             $product_label = "";
    219                             if($_product_label_config['sale_label']) {
    220                                 if ($percentage = $_portohelper->getPercentage($_product)) {
    221                                     if($_product_label_config['sale_label_percent']) {
    222                                         $product_label .= '<div class="product-label sale-label">'.$percentage.'%'.'</div>';
    223                                     } else {
    224                                         $product_label .= '<div class="product-label sale-label">'.$_product_label_config['sale_label_text'].'</div>';
    225                                     }
    226                                 }
    227                             }
    228                             if($_product_label_config['new_label']) {
    229                                 $now = date("Y-m-d");
    230                                 $newsFrom= substr($_product->getData('news_from_date')?$_product->getData('news_from_date'):'',0,10);
    231                                 $newsTo=  substr($_product->getData('news_to_date')?$_product->getData('news_to_date'):'',0,10);
    232 
    233                                 if ($newsTo != '' || $newsFrom != ''){
    234                                     if (($newsTo != '' && $newsFrom != '' && $now>=$newsFrom && $now<=$newsTo) || ($newsTo == '' && $now >=$newsFrom) || ($newsFrom == '' && $now<=$newsTo)) {
    235                                         $product_label .= '<div class="product-label new-label">'.$_product_label_config['new_label_text'].'</div>';
    236                                     }
    237                                 }
    238                             }
    239                             if($product_label)
    240                                 echo '<div class="product-labels">'.$product_label.'</div>';
    241                         ?>
    242                         <div class="product-item-inner">
    243                             <div class="product actions product-item-actions">
    244                                 <div class="actions-primary">
    245                                     <?php if ($_product->isSaleable()): ?>
    246                                         <?php $postParams = $block->getAddToCartPostParams($_product); ?>
    247                                         <form data-role="tocart-form" action="<?php echo $postParams['action']; ?>" method="post">
    248                                             <input type="hidden" name="product" value="<?php echo $postParams['data']['product']; ?>">
    249                                             <input type="hidden" name="<?php echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
    250 
    251                                             <?php echo $block->getBlockHtml('formkey')?>
    252                                             <button type="submit"
    253                                                     title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
    254                                                     class="action tocart primary">
    255                                                 <span><?php echo __('Add to Cart') ?></span>
    256                                             </button>
    257                                         </form>
    258                                     <?php else: ?>
    259                                         <?php if ($_product->getIsSalable()): ?>
    260                                             <div class="stock available"><span><?php echo __('In stock') ?></span></div>
    261                                         <?php else: ?>
    262                                             <div class="stock unavailable"><span><?php echo __('Out of stock') ?></span></div>
    263                                         <?php endif; ?>
    264                                     <?php endif; ?>
    265                                 </div>
    266                                 <?php if ($block->getMode() == 'grid'): ?>
    267                                 <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()): ?>
    268                                     <a href="#"
    269                                        class="action towishlist actions-secondary"
    270                                        title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
    271                                        aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
    272                                        data-post='<?php echo $block->getAddToWishlistParams($_product); ?>'
    273                                        data-action="add-to-wishlist"
    274                                        role="button">
    275                                         <span><?php echo __('Add to Wish List') ?></span>
    276                                     </a>
    277                                 <?php endif; ?>
    278                                 <?php endif; ?>
    279                                 <?php if($_category_config['addtocompare']): ?>
    280                                 <?php
    281                                 $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
    282                                 ?>
    283                                 <a href="#"
    284                                    class="action tocompare actions-secondary"
    285                                    title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
    286                                    aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
    287                                    data-post='<?php echo $compareHelper->getPostDataParams($_product); ?>'
    288                                    role="button">
    289                                     <span><?php echo __('Add to Compare') ?></span>
    290                                 </a>
    291                                 <?php endif; ?>
    292                             </div>
    293                         </div>
    294                     </div>
    295                     <div class="product details product-item-details">
    296                         <?php
    297                             $_productNameStripped = $block->stripTags($_product->getName(), null, true);
    298                         ?>
    299                         <strong class="product name product-item-name">
    300                             <a class="product-item-link"
    301                                href="<?php echo $_product->getProductUrl() ?>">
    302                                 <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?>
    303                             </a>
    304                         </strong>
    305                         <?php //$_category_config['rating_star'] = "";  //disabled at the moment ?>
    306                         <?php if($_category_config['rating_star']): ?>
    307                         <?php
    308                             $review_model->getEntitySummary($_product);
    309                             $review_html = $block->getReviewsSummaryHtml($_product, $templateType);
    310                         ?>
    311                         <?php if($review_html): ?>
    312                             <?php echo $block->getReviewsSummaryHtml($_product, $templateType); ?>
    313                         <?php else: ?>
    314                         <div class="product-reviews-summary short">
    315                             <div class="rating-summary">
    316                                 <span class="label"><span>Rating:</span></span>
    317                                 <div class="rating-result" title="0%">
    318                                     <span style="width:0"><span>0%</span></span>
    319                                 </div>
    320                             </div>
    321                         </div>
    322                         <?php endif; ?>
    323                         <?php endif; ?>
    324                         <?php if($_category_config['product_price']): ?>
    325                         <?php echo $block->getProductPrice($_product) ?>
    326                         <?php endif; ?>
    327                         <?php echo $block->getProductDetailsHtml($_product); ?>
    328                     </div>
    329                 </div>
    330                 <?php echo($iterator == count($_productCollection)+1 || $product_limit+1 == $iterator) ? '</div>' : '' ?>
    331                 <?php endif; ?>
    332             <?php endforeach; ?>
    333         </div>
    334         <style>
    335             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts {
    336                 margin: -<?php echo $gap_width; ?>px;
    337             }
    338             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item {
    339                 padding: <?php echo $gap_width; ?>px;
    340                 margin-bottom: 0;
    341             }
    342             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-1 {
    343                 height: <?php echo $grid_height; ?>px;
    344             }
    345             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-1-2 {
    346                 height: <?php echo $grid_height / 2 ?>px;
    347             }
    348             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-1-3 {
    349                 height: <?php echo $grid_height / 3; ?>px;
    350             }
    351             .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height-2-3 {
    352                 height: <?php echo $grid_height * 2 / 3; ?>px;
    353             }
    354             @media (max-width: 767px) {
    355                 .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height_md-1 {
    356                     height: <?php echo $grid_height ?>px;
    357                 }
    358                 .products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts .product-item.height_md-1-2 {
    359                     height: <?php echo $grid_height / 2 ?>px;
    360                 }
    361             }
    362         </style>
    363     </div>
    364     <?= $block->getPagerHtml() ?>
    365     <script type="text/javascript">
    366     require([
    367         'jquery',
    368         'Smartwave_Filterproducts/js/imagesloaded',
    369         'Smartwave_Filterproducts/js/packery.pkgd'
    370     ], function ($, imagesLoaded, Packery) {
    371         $.bridget( 'packery', Packery );
    372         var $container = $('.products-grid.masonry-grid#<?php echo $masonry_id; ?> .filterproducts').imagesLoaded(function(){
    373             $container.packery({
    374                 itemSelector: ".product-item",
    375                 percentPosition: true
    376             });
    377         });
    378     });
    379     </script>
    380     <?php if (!$block->isRedirectToCartEnabled()) : ?>
    381         <script type="text/x-magento-init">
    382         {
    383             "[data-role=tocart-form], .form.map.checkout": {
    384                 "catalogAddToCart": {}
    385             }
    386         }
    387         </script>
    388     <?php endif; ?>
    389 <?php endif; ?>